package com.nhncorp.pleiades.protocol;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import com.nhncorp.pleiades.hadoop.Writable;
import com.nhncorp.pleiades.hadoop.WritableUtils;

public class SubscriptionInfo implements Writable {
  
  private String subscriptionId;
  private String key;
  private String value;
  private String[] constraints = null;
  
  public SubscriptionInfo(String subscrptId) {
    this.subscriptionId = subscrptId;
  }

  
  public void readFields(DataInput in) throws IOException {
    subscriptionId = WritableUtils.readString(in);
    key = WritableUtils.readString(in);
    value = WritableUtils.readString(in);
    constraints = WritableUtils.readStringArray(in);
  }

  
  public void write(DataOutput out) throws IOException {
    WritableUtils.writeString(out, subscriptionId);
    WritableUtils.writeString(out, key);
    WritableUtils.writeString(out, value);
    WritableUtils.writeStringArray(out, constraints);
  }

  public String getSubscriptionId() {
    return subscriptionId;
  }

  public void setSubscriptionId(String subscriptionId) {
    this.subscriptionId = subscriptionId;
  }

  public String getKey() {
    return key;
  }

  public void setKey(String key) {
    this.key = key;
  }

  public String getValue() {
    return value;
  }

  public void setValue(String value) {
    this.value = value;
  }

}
